using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;


namespace Bots.Index
{
    public class IndexWriterTasker : IndexTasker
    {
        public IndexWriterTasker() {
        }

        public override void Run()
        {
            logger.Info("IndexWriter start:" + DateTime.Now.ToShortTimeString());
            logger.Info("ShareBufferPool.AddBuffer.Count:" + ShareBufferPool.AddBuffer.Count);
            BathAddDocument(ShareBufferPool.AddBuffer);
        }
    

        public override void Suspend()
        {
            logger.Info("IndexWriterTasker start Suspend");
            //indexWriter.Close();
            base.Suspend();
        }

        public override void Resume()
        {
            logger.Info("IndexWriterTasker start Resume");
            //indexWriter = new IndexWriter(indexDirectory, new StandardAnalyzer(), false);
            base.Resume();
        }
    }
}